package com.xb.sourest.base;

public class BaseBean<T> implements IModel {



    private String resultCode;
    private String message;
    private  T data;

    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getCode() {
        return resultCode;
    }

    public String getMessage() {
        return message;
    }
    // 判断是否请求成功
    public boolean isSuccess() {
        return "000".equals(resultCode);
    }

    @Override
    public boolean isNull() {
        if (data == null){
            return true;
        }
        return false;
    }

    @Override
    public boolean isAuthError() {
        return false;
    }

    @Override
    public boolean isBizError() {
        return false;
    }

    @Override
    public String getErrorMsg() {
        return message;
    }

    @Override
    public String code() {
        return resultCode;
    }
}
